package com.wawei.seeds.services.remote;

import com.wawei.seeds.model.HeroInfo;
import com.wawei.seeds.utils.NetBase;

import retrofit.Callback;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.Part;
import retrofit.http.Query;
import retrofit.mime.TypedFile;

/**
 *
 * Created by t27891 on 15/7/6.
 */
public interface WalnutRegAuthRestfulService {
    @FormUrlEncoded
    @POST("/user/signIn.action")
    void login(@Field("clientId")String clientId, @Field("userName")String userName, @Field("password")String password, Callback<HeroInfoRestfulWrapper> result);

    @FormUrlEncoded
    @POST("/user/signIn.action")
    void login(@Field("userName")String userName, @Field("password")String password, Callback<HeroInfoRestfulWrapper> result);

    @FormUrlEncoded
    @POST("/user/signIn.action")
    HeroInfoRestfulWrapper login(@Field("userName")String userName, @Field("password")String password);

    @FormUrlEncoded
    @POST("/user/signUp.action")
    void register(@Field("clientId")String clientId, @Field("nick")String userName, @Field("mobile")String mobile,
                  @Field("email")String email, @Field("password")String password, Callback<HeroInfoRestfulWrapper> result);

    @FormUrlEncoded
    @POST("/user/signUp.action")
    HeroInfo register(@Field("nick")String userName, @Field("mobile")String mobile,
                  @Field("email")String email, @Field("password")String password);

    @GET("/provider/info.action")
    void getHeroInfo(@Query("providerId")Integer heroId, Callback<ProviderInfoRestfulWrapper> result);

    @Multipart
    @POST("/user/icon.action")
    void uploadHeader(@Part("userId")Integer userId, @Part("myUpload")TypedFile file, @Part("myUploadFileName")String fileName, @Part("myUploadContentType")String fileType, Callback<HeroInfoRestfulWrapper> result);

    @FormUrlEncoded
    @POST("/user/password.action")
    void changePassword(@Field("userName")String userId, @Field("password")String oldPassword, @Field("newPassword")String newPassword, Callback<NetBase> result);

    @GET("/user/smsVerify.action")
    void getCode(@Query("mobile")String mobile, Callback<NetBase> result);
}
